<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('inventory', function (Blueprint $table) {
            $table->id()->unique()->comment('自增id');
$table->string('org_code', 20)->comment('组织代码');
$table->string('location', 120)->comment('库位代码');
$table->string('material_no', 150)->comment('物料代码');
$table->decimal('qty')->comment('库存数量');
$table->decimal('assign_qty')->comment('分配数量');
$table->decimal('lock_qty')->comment('冻结数量');
$table->string('lot_num')->comment('箱号/批号');
$table->creatorId();
$table->createdAt();
$table->updatedAt();
$table->deletedAt();

$table->engine='InnoDB';
$table->comment('即时库存');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('inventory');
    }
};
